/**
 * author: 何其沆(pooky)
 * desc: Phase Management - api
 * date: 2021-11-22
 */
import { get, post } from '@/utils/request.js'
import api from '@/config/index.js'

export default {
  /**
   * 获取branch和bu-个人
   * @returns {Promise | Promise<unknown>}
   */
  getBranchAndBu() {
    return get(api.API_VERSION + '/PhaseManagement/GetBranchAndBu', {}, false)
  },
  /**
   * 获取Authority
   * @returns {Promise | Promise<unknown>}
   */
  getAuthority() {
    return get(api.API_VERSION + '/Admin/PhaseManagement/GetAllBranchAndBu', {}, false)
  },
  /**
   * 根据BU或BranchID获取所有销售人员
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  getAdminEmployeeSales(data) {
    return get(api.API_VERSION + '/Admin/PhaseManagement/GetEmployeeSales', data, false)
  },
  /**
   * 修改结果-个人
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  updateResult(data) {
    return post(api.API_VERSION + '/PhaseManagement/UpdateMeasureStandardResult', data, false)
  },
  /**
   * 获取年份-个人
   * @returns {Promise | Promise<unknown>}
   */
  getYears() {
    return get(api.API_VERSION + '/PhaseManagement/GetYears', {}, false)
  },
  /**
   * 获取年份-管理
   * @returns {Promise | Promise<unknown>}
   */
  getAdminYears() {
    return get(api.API_VERSION + '/Admin/PhaseManagement/GetYears', {}, false)
  }
}
